﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using Core.Graphics;
using Core.Graphics.Layers;

namespace WorldEditor.Tiles
{
    public partial class LayerProperties : UserControl
    {
        public event EventHandler PropertiesClicked;
        public event EventHandler LayerSelected;

        public Layer Layer { get; set; }

        public LayerProperties()
        {
            InitializeComponent();
        }

        public void LoadProperties()
        {
            txtLayerName.Text = Layer.Name;
            cbVisible.Checked = Layer.Visible;
        }

        private void pbProperties_Click(object sender, EventArgs e)
        {
            if (PropertiesClicked != null)
                PropertiesClicked.Invoke(Layer, EventArgs.Empty);
        }

        private void TileLayerProperties_Click(object sender, EventArgs e)
        {
            if (LayerSelected != null)
                LayerSelected.Invoke(Layer, EventArgs.Empty);
        }
    }
}
